using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using GameFramework.Graphics;

namespace GameFramework.Controls
{
    public class TrueFalseButton : Button
    {
        private bool _value = false;
        public bool Value
        {
            get
            {
                return _value;
            }
            set
            {
                _value = value;
            }
        }

        FrameModule _disableFrame;
        public FrameModule DisableFrame
        {
            get
            {
                return _disableFrame;
            }
            set
            {
                _disableFrame = value;
            }
        }


        public TrueFalseButton(Game game, Vector2 onPosition, Vector2 activePosition, Vector2 offPosition) 
            : base(game, onPosition,activePosition, offPosition)
        {
        }

        public TrueFalseButton(Game game, Vector2 position, ButtonType type)
            : base(game, position, type)
        {
        }

        public override void AfterSelected()
        {
            _value = !_value;
            base.AfterSelected();
        }

        public override void OnNormalDraw(GameTime gameTime)
        {
            base.OnNormalDraw(gameTime);
            if (_value)
            {               
                _disableFrame.Draw(Position);
            }
        }
    }
}
